/*
 *****************************************************************************
 * Copyright (C) 2005-2011 UC Mobile Limited. All Rights Reserved
 * File			: AutomatedMenuDataProcessor.m
 *
 * Description	: 常用自动化测试设置事件驱动者
 *
 * Author		: daijb@ucweb.com
 * History		:
 *			   Creation, 2014/03/14, daijb, Create the file
 ******************************************************************************
 **/
#if defined(UC_COMMON_AUTOMATED_TEST) || defined(UC_MONKEY_TEST)
#import "VerDefine.h"

#import "AutomatedActionsDataProcessor.h"
#import "WebListManager.h"

@implementation AutomatedActionsDataProcessor

- (void)onClickGoBack:(NSString*)itemName
{
     [g_winManager.currentWebView goBack:NO];
     [self dismissWithAnimation:YES completion:nil];
}

- (void)onClickGoForward:(NSString*)itemName
{
     [g_winManager.currentWebView goForward:NO];
     [self dismissWithAnimation:YES completion:nil];
}

- (void)onClickStopLoading:(NSString*)itemName
{
     [g_winManager.currentWebView stopLoading];
     [self dismissWithAnimation:YES completion:nil];
}

- (void)onClickReload:(NSString*)itemName
{
    [g_winManager.currentWebView reload];
     [self dismissWithAnimation:YES completion:nil];
}

- (void)dismissWithAnimation:(BOOL)animation completion:(void(^)(void))completion
{
    if (self.delegate && [self.delegate respondsToSelector:@selector(dismissWithAnimatin:completion:)])
    {
        [self.delegate dismissWithAnimatin:YES completion:completion];
    }
}
@end
#endif
